import * as mongoose from 'mongoose';
import config from 'src/config/config';
import * as bcrypt from 'bcrypt';
export const UserSchema = new mongoose.Schema(
    {
        password: {
            type: String,
            required: true,
            set(value) {
                return bcrypt.hashSync(value, 10); //加密级别：10-12
            },
            select: false,
        },
        phone: { type: Number },
        last_ip: { type: String },
        email: { type: String },
        status: {
            type: Number,
        },
    },
    config.SchemaOptions,
);
